<!DOCTYPE html>
<html lang='en'>
<head>
  <meta charset='UTF-8'>
  <title>Title</title>
</head>
<body>
<div id = "app"></div>
<button onclick = "start()">点击开始播放</button>
<script type = "text/javascript">


  let text  = "this is a book 智慧城市交通联动"
  let msg = new SpeechSynthesisUtterance(text)

  function start(){
    console.log('开始播放了')
    msg.volume = 2 // 音量
    msg.rate  = 0.8 // 语速

    window.speechSynthesis.speak(msg)
  }

</script>

</body>
</html>